package com.gufe.mapper.admin.club;

import com.gufe.entity.PPTQueryParam;
import com.gufe.entity.PrecollectMember;
import com.gufe.vo.PPTvo.ApplyMemberVO;
import com.gufe.vo.PPTvo.CollegeCountVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ApplyMemberMapper {
    /**
     * 批量同意预征班申请
     * @param ids
     */
    void agreeApply(List<Integer> ids);

    @Select("SELECT IFNULL(college, '未分配学院') AS college, COUNT(*) AS member_count FROM precollect_members " +
            "WHERE status = 0 GROUP BY college ORDER BY member_count DESC")
    List<CollegeCountVO> getCollegeCount();

    /**
     * 条件查询预征班申请人员
     * @param pptQueryParam
     * @return
     */
    List<ApplyMemberVO> getApplyMembers(PPTQueryParam pptQueryParam);

    @Select("select * from precollect_members where id = #{id}")
    PrecollectMember getInfoById(Integer id);
}
